import '../css/tailwind.css'
// import 'pliny/search/algolia.css'

import type { Metadata } from 'next'
import { Inter } from 'next/font/google'

import { ThemeProviders } from './theme-providers';
import { Analytics,AnalyticsConfig } from 'pliny/analytics';
import { SearchProvider,SearchConfig } from 'pliny/search';
import SectionContainer from '@/components/SectionContainer';
import Header from '@/components/Header';
import Footer from '@/components/Footer';
import siteMetadata from '@/data/siteMetadata'

const inter = Inter({ subsets: ['latin'] })

export const metadata: Metadata = {
  title: 'DestinyJun个人网站',
  description: 'Generated by create next app',
}

export default function RootLayout({ children}: {children: React.ReactNode }) {
  return (
    <html lang="en">
      <body className={inter.className}>
      <ThemeProviders>
        <Analytics analyticsConfig={siteMetadata.analytics as AnalyticsConfig} />
        <SectionContainer>
          <div className="flex h-screen flex-col justify-between font-sans">
            <SearchProvider searchConfig={siteMetadata.search as SearchConfig}>
              <Header />
              <main className="mb-auto">
                {children}
              </main>
            </SearchProvider>
            <Footer />
          </div>
        </SectionContainer>
      </ThemeProviders>
      </body>
    </html>
  )
}
